import request from '@/utils/request'

export function categoryList() {
	return request({
		url: '/wx/module/book/category/list',
		method: 'get'
	})
}

export function bookList(query) {
	return request({
		url: '/wx/module/book/list',
		method: 'get',
		params: query
	})
}

export function secondCategoryList(categoryId) {
	return request({
		url: '/wx/module/second/category/list',
		method: 'get',
		params: {
			categoryId: categoryId
		}
	})
}

export function secondCategorysList(query) {
	return request({
		url: '/wx/module/second/categorys/list',
		method: 'get',
		params: query
	})
}

export function getBookDetail(bookId) {
	return request({
		url: '/wx/module/book/detail',
		method: 'get',
		params: {
			bookId: bookId
		}
	})
}

export function getLikeList(classifyId) {
	return request({
		url: '/wx/module/like/list',
		method: 'get',
		params: {
			classifyId: classifyId
		}
	})
}

export function bookCollection(type, bookId) {
	return request({
		url: '/wx/module/goods/collection',
		method: 'get',
		params: {
			type: type,
			goodsId: bookId
		}
	})
}

export function bookCancelCollection(type, bookId) {
	return request({
		url: '/wx/module/goods/cancel/collection',
		method: 'get',
		params: {
			type: type,
			goodsId: bookId
		}
	})
}

export function joinBookShelf(type, bookId, buyNum) {
	return request({
		url: '/wx/module/join/book/shelf',
		method: 'get',
		params: {
			type: type,
			goodsId: bookId,
			buyNum: buyNum
		}
	})
}

export function removeBookShelf(type, bookId) {
	return request({
		url: '/wx/module/remove/book/shelf',
		method: 'get',
		params: {
			type: type,
			goodsId: bookId
		}
	})
}

export function newbookList(query) {
	return request({
		url: '/wx/module/new/book/list',
		method: 'get',
		params: query
	})
}

export function newTotalBookList(query) {
	return request({
		url: '/wx/module/new/total/book/list',
		method: 'get',
		params: query
	})
}

export function recommendBookList() {
	return request({
		url: '/wx/module/recommend/book/list',
		method: 'get'
	})
}

export function recommendTotalbookList() {
	return request({
		url: '/wx/module/recommend/total/book/list',
		method: 'get'
	})
}

export function shoppingList() {
	return request({
		url: '/wx/module/bookshelf/list',
		method: 'get'
	})
}

export function collectionList() {
	return request({
		url: '/wx/module/collection/list',
		method: 'get'
	})
}

export function slideshowList(type) {
	return request({
		url: '/wx/module/get/slideshow/list',
		method: 'get',
		params: {
			type: type
		}
	})
}